1. Field of the Invention
The invention relates to the technical field of image shrinkage and expansion and, more particularly, to an image scaling system capable of saving memory.
2. Description of Related Art
Interpolations are used popularly in typical 2D image expanding and shrinking techniques. Such interpolation methods require a scan line buffer. On a longitudinal image expansion, the data of an image line is read from a main memory, and each pixel of the image line read is multiplied by a respective scaling factor and stored in the scan line buffer. Next, the data of a next image line is read, and each pixel of the next image line read is multiplied by the respective scaling factor and accumulated on the respective pixels stored in the scan line buffer. The accumulated pixels are performed with a shift operation to thereby obtain a longitudinally expanded output image.
Another typical method replaces the scan line buffer with a static random access memory (SRAM) to temporarily store a number of lines of input image data. In this case, a logic circuit is used to read the pixel values stored in the SRAM, multiply the read pixel values by the respective scaling factors, and perform accumulating and shifting operations on the accumulated pixel values. Thus, the pixel values of an output image are obtained. Such a method can reduce the number that the data is read from the SRAM, but has to increase the size of the SRAM. Accordingly, when the width of an image is very large, the size of SRAM used is increased dramatically, and thus the hardware cost of the system is considerably increased.
U.S. Pat. No. 6,219,465 granted to Nacman et al. for a “High Quality Digital Scaling Using Pixel Window Average and Linear Interpolation” has disclosed a window average for an image shrinking operation and an interpolation for an image expanding operation. The hardware configuration in the U.S. Pat. No. 6,219,465 commonly uses a scan line buffer to temporarily store data, and changes a selective scaling factor to thereby obtain desired proportions of longitudinal or latitudinal expansion and shrinkage. However, because the data of an image line is stored in an SRAM, only 1D data can be processed in a parallel mode, and as the scan line buffer is used to temporarily store median operation data, the output data requires two 2D processing for producing an out image line. The disadvantage of such a method is in that the interval between the image lines may be too long since the output image uses an image line as a unit, which is not suitable for a system with a real-time output requirement. In addition, in a serial mode, two 2D data can be processed at one time to thereby fulfill the real-time output requirement, but this requires sharing a scan line buffer. In addition, due to the sequences and speeds of processing data, one of 2D processing systems may be idle to thus reduce the output performance of the systems. Accordingly, it is desired for the typical image scaling system to be improved.